Repository navigation
Conversation
added 2 commits
November 24, 2026 11:00
Validate (JWKS) -> resolve (provider sub -> account_id via identity_link) -> role-load (live role_grant rows) -> fail-closed, as one shared module consumed by all hosted surfaces (component H design, #9086, slice H1). Claim shape is PROVISIONAL (design §8 Q1): binding_id + roles claims, pending #9077's answer to the claim-shape request filed 2026-11-24; default applies if unanswered by ~2026-12-01. Live role_grant rows are authoritative; resolve/load are interfaces H2 wires to Turso. Tests: forged / tampered / expired / foreign-audience / wrong-issuer / bad-shape / unlinked / no-live-roles all rejected; fixture token resolves to (account_id, binding_id, roles); resolve p99 0.377ms over 200 samples (design outline <50ms).
tsc rejected the importKey call: the local JsonWebKey interface (optional kty) shadowed the DOM lib type. The provider-supplied key is now cast at the call site and importKey itself validates the material (bad key denies as unknown_key). No behavior change; tests unchanged.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
3 tasks
This was referenced Nov 24, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slice H1 of #14259 (child of #9086, component H design §5): one shared
SSO relying-party front-door module for the hosted surfaces —
pm-stack/pm-service/src/front-door.ts— implementing validate (JWKS)→ resolve (provider sub → tenancy
account_idviaidentity_link) →role-load (live
role_grantrows) → fail-closed, plus its test suite(
pm-stack/pm-service/test/front-door.test.ts, 11 tests).Decisions recorded in the module header (decide-and-proceed, FDR-0013):
binding_id+rolesclaims. The claim-shape request was filed on SSO for fleet services: GitHub/Google/Microsoft login gated to Drew + devtoday OIDC provider with roles + account linking #9077 on 2026-11-24 and
is unanswered; per the design, H1 proceeds with this proposed shape
and the default applies if SSO for fleet services: GitHub/Google/Microsoft login gated to Drew + devtoday OIDC provider with roles + account linking #9077 is still unanswered ~2026-12-01.
role_grantrows are authoritative; the token's role listis a snapshot for H3's session cookie. An account with no live roles
is denied.
resolveAccountId/loadRolesare interfaces H2 wires to theTurso central tenancy DB; tests use in-memory doubles.
pm-servicebecause surface A is the first consumer (H3);promoted to a shared package when a second surface outside
pm-servicewires in.After this PR,
bun testinpm-stack/pm-serviceshows 26 pass(incl. 11 front-door tests), and the issue's second acceptance
criterion (forged / expired / foreign-audience rejected) and third
(fixture token resolves to
(account_id, binding_id, roles)insidethe <50ms p99 outline) pass. The first criterion (claim shape agreed
with #9077) stays provisional pending #9077's answer.
Refs #14259, #9086, #9077. Does not close #14259 (H2–H7 remain).
Evidence
0 pass / 11 fail, all for
not_implemented; after theimplementation, 11 pass.
fleet queue dispatchis blocked by TLS defect fleet: repo-queue dispatch fails with TLS UnknownIssuer behind the egress proxy (Rust TLS ignores SSL_CERT_FILE) #13185,invalid peer certificate: UnknownIssuer):tsc --noEmitfailed — the localJsonWebKeyinterface shadowed theDOM lib type. Fixed in 56cbe4c (renamed to
JwksKey, cast atthe
importKeycall;importKeyitself validates key material).cd pm-stack/pm-service && bun install --frozen-lockfile && bun test && bunx tsc --noEmit→ 26 pass, 0 fail;front-door resolve p99 0.104ms over 200 samples (design
outline <50ms);
tscclean.tsc --noEmitclean after the fix.Merge Danger
Low. Two new files only; no existing file touched, no surface wired —
H1 lands behind no traffic per design §6, so no behavior changes for
any hosted surface. The provisional claim shape is the one follow-up
risk: if #9077 answers with a different shape, this module's claim
parsing changes (one place, by design).
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-24T11:40:09Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "bbfc8aa3a3b4f3e3d399b7e76beb6962c0daa5b9" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.